inspector: Check a return value
authorMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 19:56:34 +0000 (15:56 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 20:11:16 +0000 (16:11 -0400)
We don't care about the error here, but we were relying on
g_resources_get_info to zero the size even in case of error.
No need to do that, we can just check the return value. Plus,
it makes coverity happy.

gtk/inspector/resource-list.c

index 32a19d4bd067b20aa10d5aaba2cd305eda5fe080..16e96514af6963f375f802281df89058a3799538 100644 (file)
@@ -120,9 +120,11 @@ load_resources_recurse (GtkInspectorResourceList *sl,
       else
         {
           count = 0;
-          g_resources_get_info (p, 0, &size, NULL, NULL);
-          *count_out += 1;
-          *size_out += size;
+          if (g_resources_get_info (p, 0, &size, NULL, NULL))
+            {
+              *count_out += 1;
+              *size_out += size;
+            }
         }
 
       stored_size = size;